<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div></div>
  <!-- 
    const spec = {size:'40cm*40cm',color:'黑色'}
    需求:将内容展示为:40cm*40cm/黑色
   -->
  <script>
    const spec = { size: '40cm*40cm', color: '黑色' }
    // 1.将对象的属性值给取过来,返回一个数组
    console.log(Object.values(spec));
    const obj = Object.values(spec)
    // 2.再用字符串拼接起来
    const content = obj.join('/')
    console.log(content);
    document.querySelector('div').innerHTML = content
  </script>
</body>

</html>